home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14302 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why does this trip over control codes (Win 3.1 SDK)
  5. Date: 13 Apr 1996 07:15:16 GMT
  6. Organization: systems hk
  7. Message-ID: <4knka4$i9s@nadine.teleport.com>
  8. References: <4kjnoe$di2@pipe10.nyc.pipeline.com>
  9. NNTP-Posting-Host: ip-pdx14-40.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. johndill@nyc.pipeline.com (John Dillworth) wrote:
  16. >I'm trying to modify the poepoem.c program from Petzold to print source
  17. >code instead of just text.  The .rc file looks like this 
  18. [snip]
  19. >The AnnabelLee  TEXT  poepoem.asc line points to an text file.  It prints
  20. >just fine.  If I want the program to print source code it has a problem
  21. >with the C control characters and stops printing when it hits one.  The
  22. >fragment from the >c file is  
  23. [snip]
  24. >               while (*lpText != '\\' && *lpText != '\0') 
  25. >                    { 
  26. >                    if (*lpText == '\n') 
  27. >                         nNumLines ++ ; 
  28. >                    lpText = AnsiNext (lpText) ; 
  29. [snip]
  30.  
  31. John,
  32.  
  33. I don't know why this snippet is checking for '\', but if you take
  34. the '*lpText != '\\' &&'  out of the test, it won't stop on a 
  35. backslash character, which it will now, and C programs are likely
  36. to have a few of...
  37.  
  38. Yours, Geoff Houck
  39.  
  40.